package com.shop.zkmall.app.service.order.placeOrderTemplate;

import com.shop.zkmall.commons.constant.IntegerEnum;
import com.shop.zkmall.commons.utils.EmptyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class PlaceOrderFactory {
    @Autowired
    private NormalPlaceOrder normalPlaceOrder;

    /**
     * 获取指定 下单方法
     * @param type /
     * @return
     */
    public PlaceOrderTemplate getPlaceOrderTemplate(Integer type) {

        if (EmptyUtils.isEmpty(type)
                || IntegerEnum.SECKILL_SUBMIT.getCode().equals(type)
                || IntegerEnum.DISCOUNT_SUBMIT.getCode().equals(type)) {
            //正常下单
            return normalPlaceOrder;
        }
        return null;
    }
}
